
import React from "react";

export default function ForecastCard({ forecast }) {
  if (!forecast) return null;
  return (
    <div className="bg-white rounded-xl shadow p-6 mt-6">
      <h2 className="text-lg font-semibold mb-4">3. 下月预测与风险</h2>
      <div className="grid grid-cols-2 gap-4 text-center">
        <div>
          <p className="text-sm text-gray-600">预期收益</p>
          <p className="text-2xl font-bold text-green-600">
            {(forecast.next_month_return * 100).toFixed(2)}%
          </p>
        </div>
        <div>
          <p className="text-sm text-gray-600">1 个月 95% VaR</p>
          <p className="text-2xl font-bold text-red-600">
            {(forecast.var_95 * 100).toFixed(2)}%
          </p>
        </div>
      </div>
    </div>
  );
}
